function okOnClick() {
	var tabletools = TableTools.fnGetInstance('table');
	var list = new Array();
	list = tabletools.fnGetSelected();
	var selectedValue = '';
	var editStoreCode = '';
	var editStoreName = '';
	for ( var i = 0; i < tabletools.fnGetSelected().length; i++) {
		var value = tabletools.fnGetSelected()[i].getElementsByTagName("td")[0].innerHTML;
		var description = tabletools.fnGetSelected()[i]
				.getElementsByTagName("td")[1].innerHTML;
		selectedValue = value;
		editStoreCode = value;
		editStoreName = description;
	}

	$("[id='stores_form:selected_value']").val(selectedValue);
	$("[id='stores_form:selected_store_code']").val(editStoreCode);
	$("[id='stores_form:selected_store_name']").val(editStoreName);
	$("[id='stores_form:edit_store_code']").val(editStoreCode);
	$("[id='stores_form:edit_store_name']").val(editStoreName);

	if (selectedValue == '') {
		alert("Please select a row first!")
	} else {
		$("#dialog_form_edit").dialog("open");
	}
	return false;
}

function createOnClick() {
	clearFields();
	$("#dialog_form_create").dialog("open");
	return false;

}

function clearFields() {

	$("[id='stores_form:selected_value']").val('');
	$("[id='stores_form:selected_store_code']").val('');
	$("[id='stores_form:selected_store_name']").val('');
}
